<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
		<title>声明常量</title>
		<script type="text/javascript">
			{
				//const num = 20
				// 20
				//console.log(num)
				//console.log('------------')
				//！！！TypeError: Assignment to constant variable.
				//常量只能在声明时，不能二次赋值
				//num = 30
				//？
				//console.log(num)
			}
			
			//??? 常用的值是不能修改的，但是常量的属性可以修改
			const person ={
				name:'tom',
				age:20
			}
			//{name: "tom", age: 20}
			console.log(person)
			console.log('--------')
			person.age = 30
			//{name: "tom", age: 20}
			console.log(person)
			
			const arr = [0,1,2,3]
			// [0, 1, 2, 3]
			console.log(arr)
			console.log('--------')
			arr[0]=100
			//[100, 1, 2, 3]
			console.log(arr)
		</script>
	</head>
	<body>
		<div id="app">
			<!-- todo -->
		</div>
	</body>
</html>
